package com.lych.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lych.dubbo.mappers.AnnouncementsMapper;
import com.lych.model.domain.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;

@DubboService
public class AnnouncementsApiImpl implements AnnouncementsApi{

    @Autowired
    private AnnouncementsMapper announcementsMapper;



    /**
     * 查询所有公告
     * @return
     */
    @Override
    public Page<Announcement> findAll(Integer page, Integer pagesize) {
        Page<Announcement> pageinfo = new Page<>(page,pagesize);

        return announcementsMapper.selectPage(pageinfo, null);


    }
}
